import java.util.Scanner;

public class text1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入机票价格");
        int ticket = sc.nextInt();
        System.out.println("请输入月份");
        int mounth = sc.nextInt();
        System.out.println("请输入购买的舱位  0.头等舱  1.经济舱");
        int seat = sc.nextInt();
        if (mounth >= 5 && mounth <= 10) {
            ticket = getTicket(seat, ticket, 0.85, 0.9);
        } else if (mounth >= 11 && mounth <= 12 || mounth >= 1 && mounth <= 4) {
            ticket = getTicket(seat, ticket, 0.65, 0.7);
        }
        else{
            System.out.println("输入错误,请重新输入");
        }
        System.out.println("需付机票" + ticket + "元");
    }

    public static int getTicket(int seat, int ticket, double x, double x1) {
        if (seat == 0) {
            ticket = (int) (x * ticket);
        } else if (seat == 1) {
            ticket = (int) (x1 * ticket);
        } else {
            System.out.println("输入错误");
        }
        return ticket;
    }
}
